package test.designmode.listener;

/* 
 * 事件源：事件发生的地点 
 */  
public class EventSource1 implements IEvent{  
    private IEventListener mEventListener;  
    private boolean button;
    private boolean mouse;
      
    //注册监听器  
    @Override  
    public void setEventListener(IEventListener arg){  
        mEventListener = arg;  
    }  
      
    //触发事件  
    public void mouseEventHappened(){  
        mouse = true;  
        mEventListener.doEvent(this);  
    }  
  
    @Override  
    public boolean clickButton() {  
        return button;  
    }  
  
    @Override  
    public boolean moveMouse() {  
        return mouse;  
    }  
  
}  